<?php
/**
 * Created by PhpStorm.
 * User: caohejie
 * Date: 2018/11/5
 * Time: 10:27
 */
require_once __DIR__ . "/ff.php";


//foreach ($_FILES as $file_info) {
//    file_put_contents('./mp4/' . $file_info['file_name'], $file_info['file_data']);
//}

$start = 10;

if (isset($_GET['start'])) {
    $start = $_GET['start'];
}


$worker = new ff('./mp4/9.mp4');
//获取视频时长
$worker->getFiletime();
//获取间隔
$worker->setJiange();
//获取视频截图
$worker->getImage($start, 20);
//获取用于生成gif的图片
$worker->getImageForGif();
//生成视频
$worker->makeFilm();
//清除文件
$worker->clearFile();

$str = '<video width="360" height="240" controls="controls" type="video/mp4" preload="auto">';
$str .= '<source src="http://192.168.2.98:666/img/all.mp4" autostart="false">';
$str .= 'Your browser does not support the video tag.';
$str .= '</video>';

echo $str;

$p = scandir("./img/pic");
foreach ($p as $val) {
    //排除目录中的.和..
    if ($val != "." && $val != "..") {
        echo '<img src="./img/pic/' . $val . '">';
    }
}


?>




